<?php
/**
 * [YIZHIKEJI System] Copyright (c) 2014 yz929.cn
 * YIZHIKEJI is NOT a free software, it under the license terms, visited http://www.yz929.cn/ for more details.
 */
defined('IN_IA') or exit('Access Denied');
//发送模板消息
load()->func('communication');

//成为商家时 发送模板消息
function teml_become_seller($title,$siteurl){
    global $_W;
    $account = WeAccount::create();
    $template_id='QpEIpA718VqCcwB3XiUgySB3nDpAdLqkuQAl9e6X_gM';
    $data = array(
        'title'=>$title,
        'siteurl'=>$siteurl,
    );
    $template = array(
        'touser'=>$_W['openid'],
        'template_id'=>$template_id,
        'url' =>$siteurl,
        'data'=>$data,
    );
    $response = $response = ihttp_post($account->getTemplateSendURL(), json_encode($template));
    unset($account);
}
